#ifndef _HEADER_HumiditySensor_H
#include "HumiditySensor.h"
#endif

HumiditySensor::HumiditySensor(/* args */)
{
}

HumiditySensor::~HumiditySensor()
{
}

void HumiditySensor::setPort(int port)
{
    this->port = port;
    pinMode(port,INPUT);
}

int HumiditySensor::getValue()
{
    this->s0Value = analogRead(port);
    this->value = map(this->s0Value,0,1023,100,0);
    return this->value;
}

void HumiditySensor::toString(char* instr)
{
    sprintf(instr,"HumiditySensor:{port=%d,s0Value=%d,value=%d}",this->port,this->s0Value,this->value);
}